// 任务-操作类型
const actionTypeList = [
  { name: '下单', code: '1' },
  { name: '评价', code: '2' },
  { name: '(只刷访客)浏览商品', code: '3' },
  { name: '(只刷访客)浏览商品+关注店铺', code: '4' },
  { name: '(只刷访客)浏览商品+关注店铺+收藏加购', code: '5' },
  { name: '购物车下单', code: '6' },
  { name: '一键仅退款', code: '7' },
  { name: '无痕加购扫码下单', code: '8' },
  { name: '全部确认收货', code: '9' }
]
// 任务-付款方式
const payMethodList = [
  { name: '支付宝代付', code: '1' },
  { name: '淘宝二维码', code: '2' },
  { name: '支付密码直接支付', code: '3' },
  { name: '云闪付', code: '4' },
  { name: '支付宝支付（第三方平台）', code: '5' },
  { name: '微信支付', code: '6' }
]
// 任务-自动收货
const vTakeDeliveryList = [
  { name: '立刻确认收货', code: '0' },
  { name: '1', code: '1' },
  { name: '2', code: '2' },
  { name: '3', code: '3' },
  { name: '4', code: '4' },
  { name: '5', code: '5' },
  { name: '6', code: '6' },
  { name: '7', code: '7' },
  { name: '不收货', code: 'random' }
]
// 任务-默认好评
const defaultPraiseList = [
  { name: '不评价', code: '1' },
  { name: '使用文字评价', code: '2' },
  { name: '默认五星好评', code: '3' }
]

// 任务-状态
const stateList = [
  { name: '未开始', code: '1' },
  { name: '进行中', code: '2' },
  { name: '已完成', code: '3' },
  { name: '已失败', code: '4' }
]

// 任务-评价状态
const evaluateStateList = [
  { name: '未开始', code: '0' },
  { name: '已跳过', code: '1' },
  { name: '已完成', code: '2' },
  { name: '已失败', code: '3' }
]

// 任务-列名字典
const colNameDictList = [
  { name: 'ID', code: 'id' },
  { name: '店铺', code: 'sName' },
  { name: '开始时间', code: 'startTime' },
  { name: '宝贝标题或链接', code: 'goodsTitleOrLink' },
  { name: '连续发布', code: 'continuousIssue' },
  { name: '是否浏览', code: 'isBrowse' },
  { name: '操作类型', code: 'actionType' },
  { name: '下单数', code: 'orderNum' },
  { name: '抢单成功设备', code: 'deviceId' },
  { name: '允许抢单设备', code: 'grabOrderDevice' },
  { name: '代付账号', code: 'replacePayAccount' },
  { name: '商品链接数1带', code: 'spljsyidai' },
  { name: '图片', code: 'img' },
  { name: '订单号', code: 'orderNo' },
  { name: '付款方式', code: 'payMethod' },
  { name: '支付密码', code: 'payPwd' },
  { name: '间隔时间', code: 'intervalTime' },
  { name: '自动收货', code: 'vTakeDelivery' },
  { name: '自动收货间隔时间', code: 'vTakeDeliveryIntervalTime' },
  { name: '下单前清空购物车', code: 'xdqqkgwc' },
  { name: 'APP', code: 'app' },
  { name: '标题查找超时', code: 'btczcs' },
  { name: '刷几遍', code: 'brushSeveralTimes' },
  { name: '状态', code: 'tState' },
  { name: '状态说明', code: 'tStateExplain' },
  { name: '评价状态', code: 'tEvaluateState' },
  { name: '评价说明', code: 'tEvaluateStateExplain' },
  { name: '获取时间', code: 'getTime' },
  { name: '结束时间', code: 'endTime' },
  { name: '评价获取时间', code: 'evaluateGetTime' },
  { name: '评价结束时间', code: 'evaluateEndTime' },
  { name: '小号备份名', code: 'wcNxshqrsh' },
  { name: '评价分组 ', code: 'qrshhpj' },
  { name: '备注', code: 'remark' },
  { name: '创建人', code: 'createUser' },
  { name: '创建时间', code: 'createTime' }
]

// 获取指定数据的Label   type：配置数据变量名
function getAssignDataLabel(v, type) {
  // console.log('v, type', v, type)
  // eslint-disable-next-line no-eval
  const obj = eval(type).find(o => o.code === v)
  // console.log('obj', obj)
  if (obj) {
    return obj.name
  }
}

export {
  actionTypeList,
  payMethodList,
  vTakeDeliveryList,
  defaultPraiseList,
  stateList,
  evaluateStateList,
  colNameDictList,
  getAssignDataLabel
}
